<li class="work" id="work_<%=h work.id %>">

<ul class="work <%- if is_author_of?(work) && controller.controller_name != 'series' -%>own<%- end -%>">
	<li class="heading">
	  <%= get_symbols_for(work) -%>
	  <h3>
	    <%= link_to sanitize_title_for_display(work.title, :tags => %w(em i b strong strike small)), work %>
  		<%= "by".t -%>
      <%= byline(work) -%>
  		<%- if work.restricted %><%= image_tag("lockblue.png", :size => "15x15", :alt => "(Restricted)".t) -%><%- end -%>
      <%- if work.hidden_by_admin -%><%= image_tag("lockred.png", :size => "15x15", :alt => "(Hidden by Admin)".t) %><%- end -%>
  </h3>
	  
	  <h4>
	    <%- unless @tags_by_category["Fandom"].nil? -%>
    	  <%- @tags_by_category["Fandom"].each do |fandom| -%>
  	  <%= link_to_tag(fandom, true) -%>
  	  <%- end -%>
  	  <%- end -%>
		&nbsp;
	  </h4>

	  <p class="update"><%= set_format_for_date(work.revised_at) %></p>
	</li>
	
	<%- cast_tags = cast_tags_for(work); freeform_tags = freeform_tags_for(work) -%>
	<%- unless ((cast_tags.size + freeform_tags.size) < 1) -%>
	<li>
		<dl class="tags">
		  <%- unless cast_tags.size < 1 -%>
			<dt><%=h 'Cast'.t + ': ' %></dt>
			<dd>
				<ul>
				  <%- cast_tags.each do |tag| -%>
					  <li><%= link_to_tag(tag, true) -%></li>
					<%- end -%>
				</ul>
			</dd>
			<%- end -%>
			
			<%- unless freeform_tags.size < 1 -%>
			<dt><%=h 'Tags'.t + ': ' %></dt>
			<dd>
				<ul>
				  <%- freeform_tags.each do |tag| -%>
					<li><%= link_to_tag(tag, true) -%></li>
					<%- end -%>
				</ul>
			</dd>
			<%- end -%>
		</dl>
	</li>
	<%- end -%>

	<li class="summary">
	  <%= sanitize_limit_and_format_for_display work.summary %>
	</li>

	<li class="stats">
		<dl>
		<dt><%=h 'Words'.t + ': ' %></dt> 
			<dd><%= number_with_delimiter(work.word_count) %></dd>
		<dt><%=h 'Chapters'.t + ': ' %></dt> 
			<dd><%= work.number_of_posted_chapters %>/<%= work.wip_length %></dd>
		<%- if work.count_visible_comments > 0 -%>
		<dt><%=h 'Comments'.t + ': '%></dt> 
			<dd><%= link_to work.count_visible_comments, work_path(:id => work.id, :anchor => "comments", :show_comments => true) -%></dd>
		<%- end -%>
		<%- if work.count_visible_bookmarks(current_user) > 0 -%>
		<dt><%=h 'Bookmarks'.t + ': '%></dt> 
			<dd><%= link_to work.count_visible_bookmarks(current_user), work_bookmarks_path(:work_id => work.id) -%></dd>
		<%- end -%>
		</dl>
	</li>
	<%- if is_author_of?(work) && controller.controller_name != 'series' -%>
	<li class="navigation"><%= link_to 'Edit'.t, edit_work_path(work) -%></li>
	<%- end -%>
	</ul>
</li>
